package basic;

class VariableParameter {
    public void sum(int... n){
        int sum = 0;
        System.out.println(n.length);
        for (int i : n){
            sum = sum + i;
        }
        System.out.println("sum=" + sum);
    }

    public static void main(String[] args) {
        VariableParameter variableParameter = new VariableParameter();
        variableParameter.sum(1);
        variableParameter.sum(2,3);
        variableParameter.sum(5,6,7);
    }
}
